package com.swallowtech.mysnscore.service;

import java.util.Date;
import java.util.List;

import com.swallowtech.mysnscore.SNSException;
import com.swallowtech.mysnscore.entity.SNSEntry;
import com.swallowtech.mysnscore.entity.Tag;
import com.swallowtech.mysnscore.entity.User;

public interface SNSEntryService {

	/**
	 * create a sns entry.like post a topic ,upload a photo and so on.
	 * @param entry
	 * @throws SNSException
	 */
	void createSNSEntry(SNSEntry entry) throws SNSException;
	
	/**
	 * remove a sns entry previously created
	 * @param entry
	 * @throws SNSException
	 */
	void removeSNSEntry(SNSEntry entry) throws SNSException;	
	
	/**
	 * Get SNS entry by id.
	 * @param id
	 * @return
	 * @throws SNSException
	 */
	SNSEntry getSNSEntry(String id) throws SNSException;
	
	
	/**
	 * Get SNSEntries by offset/length as list in reverse chronological order.
	 * @param user			User or null to get for all users.
	 * @param startDate		Start date or null for no start date.
	 * @param endDate		End date or null for no end date.
	 * @param catName		Category path or null for all categories.
	 * @param tags			Tag  or null for all tags.
	 * @param text			Text appearing in the text or summary, or null for all
	 * @param locale	
	 * @param sortBy		Sort by either 'pubTime' or 'updateTime' (null for pubTime)
	 * @param sortOrder		Sort order of ASCENDING or DESCENDING (null for DESCENDING)
	 * @param offset		Offset into results for paging
	 * @param range			Max comments to return (or -1 for no limit)
	 * @return	List of SNSEntry objects in reverse chrono order.
	 * @throws SNSException
	 */
    public List<SNSEntry> getSNSlogEntries(
            User    	user,
            Date        startDate,
            Date        endDate,
            String      catName,
            List<Tag>        tags,
            String      text,
            String      locale,                 
            String      sortBy, 
            String      sortOrder,        
            int         offset,
            int         range)
            throws SNSException;	
}
